This approach, as far as I know, is the nicest one, please tell me if you have better choice: 
http://www-128.ibm.com/developerworks/java/library/j-pg04125/
http://www-128.ibm.com/developerworks/cn/java/j-pg04125/
http://groovy.codehaus.org/GroovyMarkup
http://redhanded.hobix.com/inspect/markabyForRails.html